Skip to content

fix(ruby): lock resolved install options#9992

Draft
risu729 wants to merge 6 commits into
jdx:mainfrom
risu729:fix/ruby-build-lock-options
Draft

fix(ruby): lock resolved install options#9992
risu729 wants to merge 6 commits into
jdx:mainfrom
risu729:fix/ruby-build-lock-options

Conversation

@risu729
Copy link
Copy Markdown
Contributor

@risu729 risu729 commented May 19, 2026

Summary

  • include resolved Ruby install options in lock identity, including defaults such as compile mode, installer choice, the active build repo, and precompiled URL
  • include source-build options and patch inputs that can change compiled output or fallback output
  • add backend-level regression coverage for precompiled, experimental-default, resolved-default, source-build, fallback, and ruby-install paths

Rationale

Lock option values are part of the artifact identity. Recording resolved defaults keeps existing lockfiles stable if mise defaults change later, including Ruby's planned move toward precompiled binaries by default.

Classification

Mixed actual lock/install identity and stale-lock invalidation fix.

Actual identity: source-build settings such as installer choice, build repositories, build options, and patch inputs can change the compiled Ruby tree for the same version. Those inputs are not represented by a locked artifact URL.

Stale-lock invalidation: precompiled URL/platform selector settings mostly choose the binary artifact URL/checksum. Once the lock entry is selected, the locked URL identifies the binary, but the selector still belongs in the exact-options key so changing precompiled source or platform settings does not reuse an older lock entry.

Verification

  • cargo fmt --check
  • git diff --check
  • cargo test ruby_lockfile_options
  • GitHub Actions pending for 0d98b51f1

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR fixes the Ruby backend's lock identity to include all inputs that can change the compiled or downloaded artifact: compile mode, installer choice (ruby-build vs ruby-install), their repo URLs and extra options, patch inputs, and precompiled URL/platform selectors. Six new unit tests — guarded by a Mutex to serialise global Settings mutations — cover the precompiled, source-build, fallback, experimental-default, and ruby-install paths.

  • resolve_lockfile_options is rewritten to emit compile, ruby_install, repo, opts, and patch keys when running on the current platform, and to emit precompiled URL/arch/os keys when try_precompiled is true.
  • try_precompiled in resolve_lockfile_options duplicates the logic from should_try_precompiled() verbatim; the latter has a versioned debug_assert! reminder to update it at 2026.8.0, but the inline copy will not get that reminder.

Confidence Score: 4/5

Safe to merge; the lock identity expansion is correct and well-tested, with one minor duplication that could drift when the precompiled-default TODO is resolved.

The logic change is straightforward and backed by six targeted tests. The only concern is that try_precompiled is inlined rather than delegated to should_try_precompiled(), which carries a versioned reminder comment. If that method is updated at 2026.8.0 and the inline copy is missed, lock entries will diverge from installation behaviour.

src/plugins/core/ruby.rs — the try_precompiled duplication on lines 1028-1029 relative to should_try_precompiled() at line 441.

Important Files Changed

Filename Overview
src/plugins/core/ruby.rs Expands resolve_lockfile_options to include compile mode, installer choice, repo URLs, build options, patch inputs, and precompiled URL/platform selectors in the lock identity; adds six unit tests with mutex-based global-settings isolation covering each major installation path.

Reviews (7): Last reviewed commit: "fix(ruby): lock resolved install options" | Re-trigger Greptile

Comment thread src/plugins/core/ruby.rs Outdated
Comment thread src/plugins/core/ruby.rs Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces ToolOptionSource::InstallManifest to track and apply tool options from installation manifests, updating BackendArg and configuration resolution logic accordingly. The Ruby plugin's lockfile options were refactored into ruby_lockfile_options to include a broader set of settings such as compilation flags, installer repositories, and precompiled binary metadata. Feedback suggests simplifying a match block in the Ruby plugin using a more idiomatic if let pattern to improve readability.

Comment thread src/plugins/core/ruby.rs Outdated
@risu729

This comment was marked as outdated.

@risu729 risu729 force-pushed the fix/ruby-build-lock-options branch from 556e50e to 7fb77b1 Compare May 31, 2026 08:19
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 30bbe33d-78a0-4bed-b0d7-2685680b50a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@risu729 risu729 changed the title fix(ruby): include build source options in lock identity fix(ruby): lock resolved install options Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant